package com.app.web.config.server;

import com.app.utils.spring.ServerUrl;
import com.app.utils.spring.datasource.DynamicDataSourceContextHolder;
import com.app.web.config.mapper.UrlMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: ys1->UrlServer
 * @Auther: 但何非
 * @Date: 2022/5/11 10:22
 * @Description: 路径地址
 */
@Service
public class UrlServer {
    @Autowired
    private UrlMapper urlMapper;
    public List<ServerUrl> getUrl() {
        DynamicDataSourceContextHolder.setDataSourceKey("ysConfig");
        List<ServerUrl> list = urlMapper.getUrl();
        DynamicDataSourceContextHolder.clearDataSourceKey();
        return list;
    }
}
